tools/tests: Clean-up tools/tests/xen-access
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Thu, 26 Mar 2015 21:06:57 +0000 (22:06 +0100)
committerTim Deegan <tim@xen.org>
Thu, 9 Apr 2015 10:41:11 +0000 (11:41 +0100)
commit7189b0f6c2bc83dc15c0f43055512a463dc16c8e
treea0f70231a4309cee12dafe029f46acfd3a391552
parent9b5972a54c5453f16c71c10fdc0f5c93fc02654a
tools/tests: Clean-up tools/tests/xen-access

The spin-lock implementation in the xen-access test program is implemented
in a fashion that is actually incomplete. The x86 assembly that guarantees that
the lock is held by only one thread lacks the "lock;" instruction.

However, the spin-lock is not actually necessary in xen-access as it is not
multithreaded. The presence of the faulty implementation of the lock in a non-
multithreaded environment is unnecessarily complicated for developers who are
trying to follow this code as a guide in implementing their own applications.
Thus, removing it from the code improves the clarity on the behavior of the
system.

Also converting functions that always return 0 to return to void, and making
the teardown function actually return an error code on error.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/tests/xen-access/xen-access.c